package com.bitcola.security.activity.controller;

import com.bitcola.security.activity.biz.Airdropbiz;
import com.bitcola.security.common.context.BaseContextHandler;
import com.bitcola.security.common.msg.AppResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("airdrop")
public class AirdropController {


    @Autowired
    Airdropbiz airdropbiz;

    @RequestMapping(value = "query")

    public AppResponse history(int page,int size){
        var history=airdropbiz.history(BaseContextHandler.getUserID(),page,size);
        return AppResponse.ok().data(history);
    }

    @RequestMapping(value = "withdraw")

    public AppResponse withdraw(String id){


        airdropbiz.withdrawAirdrop(id,BaseContextHandler.getUserID());
        return AppResponse.ok();

    }

}
